// Copyright 2006 DDCT Corporation.  All rights reserved.
// Redistribution is Prohibited.
typedef struct
{
	unsigned char TagType;
	unsigned char AntNum;
	unsigned char Ids[12];
}TagIds;
typedef short apiStatus;

apiStatus __declspec(dllexport) __stdcall CommOpen (HANDLE * hCom, char *com_port);
apiStatus __declspec(dllexport) __stdcall CommClose (HANDLE hCom);
apiStatus __declspec(dllexport) __stdcall SetBaudRate(HANDLE hCom, USHORT BaudRate, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall ResetReader(HANDLE hCom, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall GetFirmwareVersion (HANDLE hCom, unsigned char *major,unsigned char *minor, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall SetRf(HANDLE hCom,unsigned char power,unsigned char freq_type,unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall GetRf(HANDLE hCom,unsigned char * power,unsigned char  *freq_type,unsigned char ReaderAddr = 0xff) ;
apiStatus __declspec(dllexport) __stdcall GetAnt(HANDLE hCom,unsigned char * ant,unsigned char ReaderAddr) ;
apiStatus __declspec(dllexport) __stdcall SetAnt(HANDLE hCom,unsigned char ant,unsigned char ReaderAddr) ;

apiStatus __declspec(dllexport) __stdcall IsoMultiTagIdentify(HANDLE hCom, unsigned int * Count,TagIds *value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall IsoMultiTagRead(HANDLE hCom,  unsigned char iRomAddr,unsigned int * Count,TagIds *value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall IsoWriteTag(HANDLE hCom ,unsigned char iRomAddr,unsigned char value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall IsoReadWithID(HANDLE hCom, unsigned char* TagID,unsigned char iRomAddr,unsigned char *AntNum,unsigned char* value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall IsoWriteWithID(HANDLE hCom, unsigned char* TagID,unsigned char iRomAddr,unsigned char value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall IsoLockTag(HANDLE hCom ,unsigned char iRomAddr, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall IsoQueryLock(HANDLE hCom, unsigned char iRomAddr,unsigned char *status, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall IsoBlockWrite(HANDLE hCom, unsigned char iRomAddr,unsigned char length,unsigned char* value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall IsoSigleTagRead(HANDLE hCom, unsigned char iRomAddr,unsigned char * value,unsigned char ReaderAddr = 0xff);

apiStatus __declspec(dllexport) __stdcall Gen2MultiTagIdentify(HANDLE hCom, unsigned int * Count,TagIds *value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall Gen2WriteEPC(HANDLE hCom ,unsigned char WordPtr,unsigned int value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall Gen2LockTag(HANDLE hCom,unsigned char MemBank ,unsigned char CtlCmd,unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall Gen2KillTag(HANDLE hCom ,unsigned int PassWord, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall Gen2InitEPC(HANDLE hCom, unsigned char WordCount = 6, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall Gen2Read(HANDLE hCom,unsigned char Membank,unsigned char WordPtr,unsigned char WordCnt, unsigned char *value, unsigned char ReaderAddr );
apiStatus __declspec(dllexport) __stdcall Gen2Write(HANDLE hCom ,unsigned char Membank,unsigned char WordPtr,unsigned int value, unsigned char ReaderAddr= 0xff );
apiStatus __declspec(dllexport) __stdcall Gen2BlockWrite(HANDLE hCom ,unsigned char Membank,unsigned char WordPtr,unsigned char WordCnt,unsigned char *value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall Gen2SetAccPwd(HANDLE hCom ,unsigned int AccPassWord, unsigned char ReaderAddr);
//apiStatus __declspec(dllexport) __stdcall Gen2SetAccPwd(HANDLE hCom ,unsigned int AccPassWord, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall Gen2SecRead(HANDLE hCom ,unsigned int AccPassWord,unsigned char Membank,unsigned char WordAddr,unsigned char WordCnt,unsigned char ReaderAddr);
apiStatus __declspec(dllexport) __stdcall Gen2SecWrite(HANDLE hCom ,unsigned int AccPassWord,unsigned char Membank,unsigned char WordAddr,unsigned int Value, unsigned char ReaderAddr);
apiStatus __declspec(dllexport) __stdcall Gen2SecLock(HANDLE hCom ,unsigned int AccPassWord,unsigned char Membank,unsigned char Level, unsigned char ReaderAddr);



apiStatus __declspec(dllexport) __stdcall GetTagData(HANDLE hCom,int Count,TagIds *value, unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall ClearIDBuffer(HANDLE hCom,unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall QueryIDCount(HANDLE hCom,unsigned char* Count,unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall GetIdWithoutDel(HANDLE hCom,unsigned char *value,unsigned char ReaderAddr = 0xff);
apiStatus __declspec(dllexport) __stdcall GetIDACK(HANDLE hCom,unsigned char ReaderAddr = 0xff);


